package com.example.sppmode.Common;

public class PairedDeviceInfo {

    public static final int DEVICE_TYPE_COMMON = 0;

    public static final String DEFAULT_MAC_ADDR = "00:00:00:00:00:00";

    protected int devType = DEVICE_TYPE_COMMON;
    protected String name;
    protected String macAddr;
    protected int rssi;
    protected long pairedTime;

    public PairedDeviceInfo() {
        clear();
    }

    public PairedDeviceInfo(int devType, String name, String macAddr) {
        this.devType = devType;
        this.name = name;
        this.macAddr = macAddr;
    }

    public PairedDeviceInfo(int devType, String name, String macAddr, int rssi) {
        this.devType = devType;
        this.name = name;
        this.macAddr = macAddr;
        this.rssi = rssi;
    }

    public void clear() {
        devType = DEVICE_TYPE_COMMON;
        name = null;
        macAddr = DEFAULT_MAC_ADDR;
        rssi = 0;
    }

    public boolean isValidDevice(){
        if(name == null)
            return false;

        if(macAddr == null)
            return false;

        if(macAddr.equals(DEFAULT_MAC_ADDR))
            return false;

        return true;
    }


    public int getDevType() {
        return devType;
    }

    public void setDevType(int devType) {
        this.devType = devType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMacAddr() {
        return macAddr;
    }

    public void setMacAddr(String macAddr) {
        this.macAddr = macAddr;
    }

    public int getRssi() {
        return rssi;
    }

    public void setRssi(int rssi) {
        this.rssi = rssi;
    }

    public long getPairedTime() {
        return pairedTime;
    }

    public void setPairedTime(long pairedTime) {
        this.pairedTime = pairedTime;
    }


}
